/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sanjose.proyectopatpro.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Joverxito
 */
@Entity
@Table(name = "Nota", catalog = "BDSanJose", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Nota.findAll", query = "SELECT n FROM Nota n"),
    @NamedQuery(name = "Nota.findByIdNota", query = "SELECT n FROM Nota n WHERE n.idNota = :idNota"),
    @NamedQuery(name = "Nota.findByFechaNota", query = "SELECT n FROM Nota n WHERE n.fechaNota = :fechaNota"),
    @NamedQuery(name = "Nota.findByTipoNota", query = "SELECT n FROM Nota n WHERE n.tipoNota = :tipoNota")})
public class Nota implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idNota", nullable = false, length = 11)
    private String idNota;
    @Basic(optional = false)
    @Column(name = "fechaNota", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaNota;
    @Basic(optional = false)
    @Column(name = "tipoNota", nullable = false)
    private int tipoNota;
    @JoinColumn(name = "idUsuario", referencedColumnName = "idUsuario", nullable = false)
    @ManyToOne(optional = false)
    private Usuario idUsuario;
    @JoinColumn(name = "numRecibo", referencedColumnName = "numRecibo", nullable = false)
    @ManyToOne(optional = false)
    private Recibo numRecibo;

    public Nota() {
    }

    public Nota(String idNota) {
        this.idNota = idNota;
    }

    public Nota(String idNota, Date fechaNota, int tipoNota) {
        this.idNota = idNota;
        this.fechaNota = fechaNota;
        this.tipoNota = tipoNota;
    }

    public String getIdNota() {
        return idNota;
    }

    public void setIdNota(String idNota) {
        this.idNota = idNota;
    }

    public Date getFechaNota() {
        return fechaNota;
    }

    public void setFechaNota(Date fechaNota) {
        this.fechaNota = fechaNota;
    }

    public int getTipoNota() {
        return tipoNota;
    }

    public void setTipoNota(int tipoNota) {
        this.tipoNota = tipoNota;
    }

    public Usuario getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Usuario idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Recibo getNumRecibo() {
        return numRecibo;
    }

    public void setNumRecibo(Recibo numRecibo) {
        this.numRecibo = numRecibo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNota != null ? idNota.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nota)) {
            return false;
        }
        Nota other = (Nota) object;
        if ((this.idNota == null && other.idNota != null) || (this.idNota != null && !this.idNota.equals(other.idNota))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sanjose.proyectopatpro.entity.Nota[ idNota=" + idNota + " ]";
    }
    
}
